
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:massagist/models/massage_model_entity.dart';
import 'package:massagist/views/mass_appbar.dart';

import '../generated/l10n.dart';
import '../manager/config.dart';

class MassageInfoPage extends StatefulWidget {
  MassageModelEntity model;
  MassageInfoPage({required this.model});
  @override
  State<MassageInfoPage> createState() => MassageInfoPageState();
}

class MassageInfoPageState extends State<MassageInfoPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: MassAppbar(title: S.current.MASSGE_DETAIL,),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Container(
            width: ScreenUtil().screenWidth,
            height: ScreenUtil().screenWidth,
            child: ClipRRect(
              child: Image.network(
                widget.model.image, fit: BoxFit.cover,
              ),
            ),
          ),
          Container(
            height: 66.sp,
            alignment: Alignment.centerLeft,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Container(
                  margin: EdgeInsets.only(left: 8.sp, top: 7.sp),
                  child: Text(widget.model.name, style: TextStyle(fontSize: 15.sp, fontWeight: FontWeight.w700, color: Color(0xFF110604))),
                ),
                Container(
                  margin: EdgeInsets.only(left: 8.sp, right: 8.sp, bottom: 8.sp),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Text("￥" + widget.model.pay, style: TextStyle(fontSize: 17.sp, fontWeight: FontWeight.w700, color: Color(0xFFFF5147))),
                      Row(
                        children: [
                          Image.asset("assets/images/time_icon.png", width: 12.sp, height: 12.sp),
                          Container(
                            margin: EdgeInsets.only(left: 2.sp),
                            child: Text(widget.model.time, style: TextStyle(fontSize: 12.sp, color: Color(0xFF999999))),
                          )
                        ],
                      )
                    ],
                  ),
                ),
              ],
            ),
          ),

          Container(
            margin: EdgeInsets.only(left: 12.sp),
            child: Stack(
              children: [
                Container(
                  child: Image.asset("assets/images/star_mask.png", width: 34.sp, height: 34.sp,),
                ),
                Container(
                  height: 20.sp,
                  margin: EdgeInsets.only(top: 4.sp),
                  child: Text(S.current.MASSGE_DETAIL, style: TextStyle(fontSize: 14.sp, fontWeight: FontWeight.w700, color: Color(0xFF110604))),
                ),
              ],
            ),
          ),

          Container(
            child: Text(
              widget.model.contant,
              style: TextStyle(
                fontSize: 12.sp,
                fontWeight: FontWeight.w300,
              ),
            ),
          )
        ],
      ),
    );
  }
}